package com.jiadeyu.pojo;

import com.baomidou.mybatisplus.annotation.TableName;
import com.jiadeyu.anno.ArticleState;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.groups.Default;
import lombok.Data;

import java.time.LocalDateTime;
@Data
public class Article {
    @NotNull(groups = Article.Update.class)
    private Integer id; // 主键ID
    @NotEmpty
    private String title; // 文章标题
    @NotEmpty
    private String content; // 文章内容
    private String coverImg; // 封面图像

    @ArticleState
    private String state; // 发布状态
    private Integer categoryId; // 文章分类ID
    private Integer createUser; // 创建人ID
    private LocalDateTime createTime;
    private LocalDateTime updateTime;

    public interface Add extends Default {}

    public interface Update extends Default {}
}
